package com.xioyi.news.action;

import java.io.File;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DownloadAction;

public class Download extends DownloadAction {

	@Override
	protected StreamInfo getStreamInfo(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		StreamInfo sf=new FileStreamInfo("text/txt",new File(request.getSession().getServletContext().getRealPath("/")+"/page/Welcome.jsp"));
		//response.setHeader("Content-disposition", "attachment; filename=123.txt");
		return sf;
	}

}
